import re

class Processor:
    def __init__(self, communicator):
        self.comm = communicator
        self.alive = True

    def process(self, msg):
        pass


class JoinProcessor(Processor):

    # example:
    # [server]: player is ready. ClientID=3 addr=1.2.4.8:16326 secure=yes
    # Attention! ClientID is printed as *hexadecimal*!
    exp = (r'^\[server\]: player is ready. ClientID=(?P<id>[0-9a-fA-F]+) '
           r'addr=(?P<ip>\d+\.\d+\.\d+\.\d+)')
    
    def __init__(self, communicator):
        super().__init__(communicator)
        self.pattern = re.compile(self.exp)
